package com.qianclass.talklive.app.im;

public class InPacket {
	public static final String TAG = "InPacket";
	public byte[] bytePayload = null;
	public int nPayloadLen;

	public int mOffset;

	public InPacket( byte[] paraPayload, int paraLen)
	{
		nPayloadLen = paraLen;
		bytePayload = new byte[nPayloadLen];
		System.arraycopy( paraPayload,0,bytePayload,0,nPayloadLen);
	}

	/**
	 * 以int类型截取字节
	 * @return
	 */
	public int getValueByInt()
	{
		return getValueByInt(0);
	}

	/**
	 * 以int类型截取字节
	 * @return
	 */
	public int getValueByInt(int defValue)
	{
		int intRet = defValue;
		if(nPayloadLen - mOffset >= 4){
			byte[] byteTmp = new byte[4];

			System.arraycopy(bytePayload, mOffset, byteTmp, 0, 4);
			mOffset += 4;
			intRet = Converter.byte2int(byteTmp);
		}
		return intRet;
	}

	/**
	 * 以String类型截取字节
	 * @return
	 */
	public String getValueByString()
	{
		String strRet = "";
		short strLen = getValueByShort();

		if(strLen > 0)
		{
			byte[] byteTmp = new byte[strLen-1];
			System.arraycopy(bytePayload, mOffset, byteTmp, 0, strLen-1);
			mOffset += strLen;
			strRet = new String(byteTmp);
		}

		return strRet;
	}

	/**
	 * 以short类型截取字节
	 * @return
	 */
	public short getValueByShort()
	{
		return getValueByShort((short) 0);
	}

	/**
	 * 以short类型截取字节
	 * @return
	 */
	public short getValueByShort(short defValue)
	{
		short shortRet = defValue;
		if(nPayloadLen - mOffset >= 2){
			byte[] byteTmp = new byte[2];

			System.arraycopy(bytePayload, mOffset, byteTmp, 0, 2);
			mOffset += 2;
			shortRet = Converter.byte2short(byteTmp);
		}
		return shortRet;
	}

	public String getValue()
	{
		byte[] tmp = new byte[nPayloadLen - 1];
		System.arraycopy(bytePayload, 0, tmp, 0, nPayloadLen - 1);
		String data = new String(tmp);

		if (data == null) {
			data = "";
		}

		return data;
	}


	/*public void parse_OnRegister(Integer[] user_id, Integer[] user_agency_id, String[] user_agency_name, String[] user_org_name, Integer[] err_code)
	{
		try
		{
			byte[] byteTmp = new byte[4];
			int offset = 0;
			System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
			offset += 4;
			err_code[0] = Converter.byte2int(byteTmp);

			if( err_code[0] == ConstantDefination.RESULT_SUCCESS )
			{
				// 用户id
				System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
				offset += 4;
				user_id[0] = Converter.byte2int(byteTmp);



				LogUtil.i(TAG, "parse_OnRegister: "+user_id[0]);
				// 用户代理id
				byteTmp = new byte[4];

				System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
				offset += 4;
				user_agency_id[0] = Converter.byte2int(byteTmp);

				// 代理名称长度
				byteTmp = new byte[2];
				System.arraycopy(bytePayload, offset, byteTmp, 0, 2);
				offset += 2;
				int user_agency_name_len = Converter.byte2short(byteTmp);

				// 代理名
				byteTmp = new byte[user_agency_name_len];
				System.arraycopy(bytePayload, offset, byteTmp, 0, user_agency_name_len);
				offset += user_agency_name_len;
				user_agency_name[0] = new String(byteTmp);
				if(user_agency_name[0].endsWith("\0"))
				{
					user_agency_name[0] = user_agency_name[0].substring(0, user_agency_name[0].length() - 1);
				}

				// 机构名长度
				byteTmp = new byte[2];
				System.arraycopy(bytePayload, offset, byteTmp, 0, 2);
				offset += 2;
				int user_org_name_len = Converter.byte2short(byteTmp);

				// 机构名
				byteTmp = new byte[user_org_name_len];
				System.arraycopy(bytePayload, offset, byteTmp, 0, user_org_name_len);
				offset += user_org_name_len;
				user_org_name[0] = new String(byteTmp);
				if(user_org_name[0].endsWith("\0"))
				{
					user_org_name[0] = user_org_name[0].substring(0, user_org_name[0].length() - 1);
				}
			}
		}
		catch(Exception e)
		{
			user_id[0] = 0;
			user_agency_id[0] = 0;
			user_agency_name[0] = null;
			user_org_name[0] = null;
			err_code[0] = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnFetchAgInfo(AgencyManager agency_manager, Integer[] errcode)
	{
		try
		{
			Integer offset = 0;
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			offset += 4;
			errcode[0] = Converter.byte2int(tmp);

			if(errcode[0] == ConstantDefination.RESULT_SUCCESS)
			{
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer count = Converter.byte2int(tmp);

				for( Integer i = 0; i < count; i++)
				{
					System.arraycopy(bytePayload, offset, tmp, 0, 4);
					offset += 4;
					Integer agid = Converter.byte2int(tmp);

					tmp = new byte[2];
					System.arraycopy(bytePayload, offset, tmp, 0, 2);
					offset += 2;
					Short len = Converter.byte2short(tmp);

					tmp = new byte[len];
					System.arraycopy(bytePayload, offset, tmp, 0, len);
					offset += len;
					String agency_name = new String(tmp);
					if(agency_name.endsWith("\0"))
					{
						agency_name = agency_name.substring(0, agency_name.length() - 1);
					}

					agency_manager.AddAgency(agid, agency_name);
				}
			}
		}
		catch(Exception e)
		{
			errcode[0] = ConstantDefination.ERR_PACKET;
			agency_manager.Clear();
		}
	}
	public void parse_OnUnRegister(Integer[] errcode)
	{
		try
		{
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, 0, tmp, 0, 4);
			errcode[0] = Converter.byte2int(tmp);
		}
		catch(Exception e)
		{
			errcode[0] = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnJoinGroup(Integer[] group_id, Integer[] group_agent_id, String[] group_agency_name, String[] group_org_name, ArrayList<User> arrUser, Integer[] err_code)
	{
		try
		{
			int offset = 0;
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			offset += 4;
			err_code[0] = Converter.byte2int(tmp);

			if( err_code[0] == ConstantDefination.RESULT_SUCCESS )
			{
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				group_id[0] = Converter.byte2int(tmp);


				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer group_count = Converter.byte2int(tmp);

				tmp = new byte[4];
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				group_agent_id[0] = Converter.byte2int(tmp);
				offset += 4;

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				short agent_len = Converter.byte2short(tmp);

				tmp = new byte[agent_len];
				System.arraycopy(bytePayload, offset, tmp, 0, agent_len);
				offset += agent_len;
				group_agency_name[0] = new String( tmp );
				if(group_agency_name[0].endsWith("\0"))
				{
					group_agency_name[0] = group_agency_name[0].substring(0, group_agency_name[0].length()-1);
				}

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				short org_len = Converter.byte2short(tmp);

				tmp = new byte[org_len];
				System.arraycopy(bytePayload, offset, tmp, 0, org_len);
				offset += org_len;
				group_org_name[0] = new String(tmp);
				if(group_org_name[0].endsWith("\0"))
				{
					group_org_name[0] = group_org_name[0].substring(0, group_org_name[0].length()-1);
				}


				for( int i = 0; i < group_count; i++ )
				{
					User user = new User();
					tmp = new byte[4];
					System.arraycopy(bytePayload, offset, tmp, 0, 4);
					offset += 4;
					Integer uid = Converter.byte2int(tmp);
					user.uid = uid.toString();

					System.arraycopy(bytePayload, offset, tmp, 0, 4);
					offset += 4;
					Integer type = Converter.byte2int(tmp);
					user.type = type.toString();

					tmp = new byte[2];
					System.arraycopy(bytePayload, offset, tmp, 0, 2);
					offset += 2;
					short name_len = Converter.byte2short(tmp);

					tmp = new byte[name_len];
					System.arraycopy(bytePayload, offset, tmp, 0, name_len);
					offset += name_len;
					String user_name = new String( tmp );
					if(user_name.endsWith("\0"))
					{
						user_name = user_name.substring(0, user_name.length()-1);
					}
					user.name = user_name;

					tmp = new byte[4];
					System.arraycopy(bytePayload, offset, tmp, 0, 4);
					user.agent_id = Converter.byte2int(tmp);
					offset += 4;

					tmp = new byte[2];
					System.arraycopy(bytePayload, offset, tmp, 0, 2);
					offset += 2;
					short user_agent_len = Converter.byte2short(tmp);


					tmp = new byte[user_agent_len];
					System.arraycopy(bytePayload, offset, tmp, 0, user_agent_len);
					offset += user_agent_len;
					String user_agent = new String( tmp );
					if(user_agent.endsWith("\0"))
					{
						user_agent = user_agent.substring(0, user_agent.length()-1);
					}
					user.agent = user_agent;

					tmp = new byte[2];
					System.arraycopy(bytePayload, offset, tmp, 0, 2);
					offset += 2;
					short user_org_len = Converter.byte2short(tmp);

					tmp = new byte[user_org_len];
					System.arraycopy(bytePayload, offset, tmp, 0, user_org_len);
					offset += user_org_len;
					String user_org = new String( tmp );
					if(user_org.endsWith("\0"))
					{
						user_org = user_org.substring(0, user_org.length()-1);
					}
					user.org = user_org;

					arrUser.add(user);
				}
			}
			else
			{
				group_id[0] = 0;
				group_agent_id[0] = 0;
				group_agency_name[0] = null;
				group_org_name[0] = null;
				err_code[0] = 0;
				arrUser.clear();
			}
		}
		catch( Exception e)
		{
			err_code[0] = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnGroupUserList(Integer[] group_id, Integer[] group_agent_id, String[] group_agency_name, String[] group_org_name, ArrayList<User> arrUser)
	{
		try
		{
			int offset = 0;
			byte[] tmp = new byte[4];

			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			offset += 4;
			group_id[0] = Converter.byte2int(tmp);


			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			offset += 4;
			Integer group_count = Converter.byte2int(tmp);

			tmp = new byte[4];
			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			group_agent_id[0] = Converter.byte2int(tmp);
			offset += 4;

			tmp = new byte[2];
			System.arraycopy(bytePayload, offset, tmp, 0, 2);
			offset += 2;
			short agent_len = Converter.byte2short(tmp);

			tmp = new byte[agent_len];
			System.arraycopy(bytePayload, offset, tmp, 0, agent_len);
			offset += agent_len;
			group_agency_name[0] = new String(tmp );
			if(group_agency_name[0].endsWith("\0"))
			{
				group_agency_name[0] = group_agency_name[0].substring(0, group_agency_name[0].length()-1);
			}

			tmp = new byte[2];
			System.arraycopy(bytePayload, offset, tmp, 0, 2);
			offset += 2;
			short org_len = Converter.byte2short(tmp);

			tmp = new byte[org_len];
			System.arraycopy(bytePayload, offset, tmp, 0, org_len);
			offset += org_len;
			group_org_name[0] = new String(tmp);
			if(group_org_name[0].endsWith("\0"))
			{
				group_org_name[0] = group_org_name[0].substring(0, group_org_name[0].length()-1);
			}


			for( int i = 0; i < group_count; i++ )
			{
				User user = new User();
				tmp = new byte[4];
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer uid = Converter.byte2int(tmp);
				user.uid = uid.toString();

				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer type = Converter.byte2int(tmp);
				user.type = type.toString();

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				short name_len = Converter.byte2short(tmp);

				tmp = new byte[name_len];
				System.arraycopy(bytePayload, offset, tmp, 0, name_len);
				offset += name_len;
				String user_name = new String(tmp );
				if(user_name.endsWith("\0"))
				{
					user_name = user_name.substring(0, user_name.length()-1);
				}
				user.name = user_name;

				tmp = new byte[4];
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				user.agent_id = Converter.byte2int(tmp);
				offset += 4;

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				short user_agent_len = Converter.byte2short(tmp);


				tmp = new byte[user_agent_len];
				System.arraycopy(bytePayload, offset, tmp, 0, user_agent_len);
				offset += user_agent_len;
				String user_agent = new String(tmp );
				if(user_agent.endsWith("\0"))
				{
					user_agent = user_agent.substring(0, user_agent.length()-1);
				}
				user.agent = user_agent;

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				short user_org_len = Converter.byte2short(tmp);

				tmp = new byte[user_org_len];
				System.arraycopy(bytePayload, offset, tmp, 0, user_org_len);
				offset += user_org_len;
				String user_org = new String(tmp );
				if(user_org.endsWith("\0"))
				{
					user_org = user_org.substring(0, user_org.length()-1);
				}
				user.org = user_org;

				arrUser.add(user);
			}
		}
		catch( Exception e)
		{
			e.printStackTrace();
		}
	}

	public void parse_OnLeaveGroup(String[] gCode, Integer[] errcode)
	{
		try
		{
			Integer offset = 0;
			byte[] byteTmp = new byte[4];
			System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
			offset += 4;
			errcode[0] = Converter.byte2int(byteTmp);
			if( errcode[0] == ConstantDefination.RESULT_SUCCESS)
			{
				System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
				offset += 4;
				Integer gid = Converter.byte2int(byteTmp);

				byteTmp = new byte[2];
				System.arraycopy(bytePayload, offset, byteTmp, 0, 2);
				offset += 2;
				Short agency_len = Converter.byte2short(byteTmp);

				byteTmp = new byte[agency_len];
				System.arraycopy(bytePayload, offset, byteTmp, 0, agency_len);
				offset += agency_len;
				String agency_name = new String(byteTmp);
				if(agency_name.endsWith("\0"))
				{
					agency_name = agency_name.substring(0, agency_name.length() - 1);
				}

				byteTmp = new byte[2];
				System.arraycopy(bytePayload, offset, byteTmp, 0, 2);
				offset += 2;
				Short org_len = Converter.byte2short(byteTmp);

				byteTmp = new byte[org_len];
				System.arraycopy(bytePayload, offset, byteTmp, 0, org_len);
				offset += org_len;
				String org_name = new String(byteTmp);
				if(org_name.endsWith("\0"))
				{
					org_name = org_name.substring(0, org_name.length() - 1);
				}

				gCode[0] = "g:" + gid.toString() + "@" + org_name + "." + agency_name;
			}
			else
			{
				gCode[0] = null;
			}
		}
		catch(Exception e)
		{
			errcode[0] = ConstantDefination.ERR_PACKET;
			gCode[0] = null;
		}
	}

	public void parse_OnUserJoinGroup(String[] gcode, String[] account, String[] name, int[] type)
	{
		try
		{
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, 0, tmp, 0, 4);
			int errcode = Converter.byte2int(tmp);
			if( errcode == ConstantDefination.RESULT_SUCCESS )
			{
				System.arraycopy(bytePayload, 4, tmp, 0, 4);
				Integer gid = Converter.byte2int(tmp);
				gcode[0] = gid.toString();

				System.arraycopy(bytePayload, 8, tmp, 0, 4);
				Integer uid = Converter.byte2int(tmp);

				System.arraycopy(bytePayload, 12, tmp, 0, 4);
				type[0] = Converter.byte2int(tmp);

				tmp = new byte[2];
				System.arraycopy(bytePayload, 16, tmp, 0, 2);
				short name_len = Converter.byte2short(tmp);

				tmp = new byte[name_len];
				System.arraycopy(bytePayload, 18, tmp, 0, name_len);
				String user_name = new String(tmp);
				name[0] = user_name;
				if(name[0].endsWith("\0"))
				{
					name[0] = name[0].substring(0, name[0].length() - 1);
				}

				tmp = new byte[4];
				System.arraycopy(bytePayload, 18 + name_len, tmp, 0, 4);
				Integer agent_id = Converter.byte2int(tmp);

				tmp = new byte[2];
				System.arraycopy(bytePayload, 22 + name_len, tmp, 0, 2);
				int agent_len = Converter.byte2short(tmp);

				tmp = new byte[agent_len];
				System.arraycopy(bytePayload, 24 + name_len, tmp, 0, agent_len);
				String agent = new String(tmp);
				if(agent.endsWith("\0"))
				{
					agent = agent.substring(0, agent.length() - 1);
				}

				tmp = new byte[2];
				System.arraycopy(bytePayload, 24 + name_len + agent_len, tmp, 0, 2);
				short org_len = Converter.byte2short(tmp);

				tmp = new byte[org_len];
				System.arraycopy(bytePayload, 26 + name_len + agent_len, tmp, 0, org_len);
				String org = new String(tmp);
				if(org.endsWith("\0"))
				{
					org = org.substring(0, org.length() - 1);
				}

				// 构造account
				account[0] = uid.toString() + ":" + name[0] + "@" + org + "." + agent;
			}
			else
			{
				gcode[0] = null;
				account[0] = null;
				name[0] = null;
				type[0] = -1;
			}
		}
		catch(Exception e)
		{
			gcode[0] = null;
			account[0] = null;
			name[0] = null;
			type[0] = -1;
		}
	}

	public void parse_OnUserLeaveGroup(Integer[] gid, String[] account, String[] name, Integer[] type, Integer[] leaveType, Integer[] err_code)
	{
		try
		{
			Integer offset = 0;
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, offset, tmp, 0, 4);
			offset += 4;
			err_code[0] = Converter.byte2int(tmp);

			if( err_code[0] == ConstantDefination.RESULT_SUCCESS)
			{
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				gid[0] = Converter.byte2int(tmp);

				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer uid = Converter.byte2int(tmp);

				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				type[0] = Converter.byte2int(tmp);

				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				Short len = Converter.byte2short(tmp);

				tmp = new byte[len];
				System.arraycopy(bytePayload, offset, tmp, 0, len);
				offset += len;
				name[0] = new String(tmp);
				if(name[0].endsWith("\0"))
				{
					name[0] = name[0].substring(0, name[0].length() - 1);
				}

				tmp = new byte[4];
				System.arraycopy(bytePayload, offset, tmp, 0, 4);
				offset += 4;
				Integer agency_id = Converter.byte2int(tmp);

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				Short agency_name_len = Converter.byte2short(tmp);

				tmp = new byte[agency_name_len];
				System.arraycopy(bytePayload, offset, tmp, 0, agency_name_len);
				offset += agency_name_len;
				String agency_name = new String(tmp);
				if(agency_name.endsWith("\0"))
				{
					agency_name = agency_name.substring(0, agency_name.length() - 1);
				}

				tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				Short org_len = Converter.byte2short(tmp);

				tmp = new byte[org_len];
				System.arraycopy(bytePayload, offset, tmp, 0, org_len);
				offset += org_len;
				String org_name = new String(tmp);
				if(org_name.endsWith("\0"))
				{
					org_name = org_name.substring(0, org_name.length() - 1);
				}

				*//*tmp = new byte[2];
				System.arraycopy(bytePayload, offset, tmp, 0, 2);
				offset += 2;
				Short leavetype = Converter.byte2short(tmp);
				leaveType[0] = Integer.valueOf(leavetype);
				Log.e("leavetype", String.valueOf(leavetype));*//*
				leaveType[0] = 1;
				account[0] = uid.toString() + ":" + name[0] + "@" + org_name + "." + agency_name;
			}
			else
			{
				gid[0] = 0;
				account[0] = null;
				name[0] = null;
				type[0] = 0;
				leaveType[0] = 1;
			}
		}
		catch(Exception e)
		{
			err_code[0] = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnReceiveMessage(String[] account, String[] data)
	{
		try
		{
			byte[] tmp = new byte[nPayloadLen];
			System.arraycopy(bytePayload, 0, tmp, 0,nPayloadLen);
			data[0] = new String(tmp);
		}
		catch(Exception e)
		{
			data[0] = null;
		}
	}

	public void parse_OnReceiveGroupMessage(String[] data)
	{
		try
		{
			byte[] tmp = new byte[nPayloadLen];
			System.arraycopy(bytePayload, 0, tmp, 0, nPayloadLen);
			data[0] = new String(tmp);
		}
		catch(Exception e)
		{
			data[0] = null;
		}
	}

	public void parse_OnCloseConnection(int errcode)
	{
		try
		{
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, 0, tmp, 0, 4);
			errcode = Converter.byte2int(tmp);
		}
		catch(Exception e)
		{
			errcode = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnServerNotification(Integer[] err_code)
	{
		try
		{
			byte[] tmp = new byte[4];
			System.arraycopy(bytePayload, 0, tmp, 0, 4);
			err_code[0] = Converter.byte2int(tmp);
		}
		catch(Exception e)
		{
			err_code[0] = ConstantDefination.ERR_PACKET;
		}
	}

	public void parse_OnLockUserAccount(Integer[] user_id, Integer[] lock_type, Integer[] err_code)
	{
		try
		{
			byte[] byteTmp = new byte[4];
			int offset = 0;
			System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
			offset += 4;
			err_code[0] = Converter.byte2int(byteTmp);

			Log.i(TAG, "parse_err_code: "+err_code[0]);

			if( err_code[0] == ConstantDefination.RESULT_SUCCESS )
			{
				// 用户id
				System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
				offset += 4;
				user_id[0] = Converter.byte2int(byteTmp);

				Log.i(TAG, "parse_OnLockUserAccount: "+user_id[0]);
				// 锁定类型
				byteTmp = new byte[4];

				System.arraycopy(bytePayload, offset, byteTmp, 0, 4);
				offset += 4;
				lock_type[0] = Converter.byte2int(byteTmp);
				Log.i(TAG, "parse_lock_type: "+lock_type[0]);
			}
		}
		catch(Exception e)
		{
			user_id[0] = 0;
			lock_type[0] = 0;
			err_code[0] = ConstantDefination.ERR_EXCEPTION;
		}
	}*/
}
